package com.cnap.db.entity;

import com.cnap.model.schedule.ClusterInfoVO;
import com.cnap.model.schedule.engine.EngineClusterInfo;

import java.util.ArrayList;
import java.util.List;

/**
 * 策略数据类
 *
 * @author xc
 **/
public class StrategyPO {
    // id
    private String id;
    // 微服务id
    private String serviceId;
    /**
     * 策略类型，schedule：调度策略，scale：扩缩容策略
     */
    private String type;
    // 策略名称
    private String strategyName;
    // 策略参数
    private String strategyParam;
    /**
     * 使用默认配置，1：使用，0：不使用
     */
    private int enableDefault;
    // 集群信息
    private List<EngineClusterInfo> clusterInfos;
    // 扩缩容策略类型
    private String scaleType;
    // 已部署的集群信息
    private List<EngineClusterInfo> oldClusterInfos;


    /**
     * get
     *
     * @return OldClusterInfos
     */
    public List<EngineClusterInfo> getOldClusterInfos() {
        return oldClusterInfos;
    }

    /**
     * set
     *
     * @param oldClusterInfos oldClusterInfos
     */
    public void setOldClusterInfos(List<EngineClusterInfo> oldClusterInfos) {
        this.oldClusterInfos = oldClusterInfos;
    }

    /**
     * get
     *
     * @return ScaleType
     */
    public String getScaleType() {
        return scaleType;
    }

    /**
     * set
     *
     * @param scaleType scaleType
     */
    public void setScaleType(String scaleType) {
        this.scaleType = scaleType;
    }

    /**
     * get
     *
     * @return Id
     */
    public String getId() {
        return id;
    }

    /**
     * set
     *
     * @param id id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * get
     *
     * @return ServiceId
     */
    public String getServiceId() {
        return serviceId;
    }

    /**
     * set
     *
     * @param serviceId serviceId
     */
    public void setServiceId(String serviceId) {
        this.serviceId = serviceId;
    }

    /**
     * get
     *
     * @return Type
     */
    public String getType() {
        return type;
    }

    /**
     * set
     *
     * @param type type
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     * get
     *
     * @return StrategyName
     */
    public String getStrategyName() {
        return strategyName;
    }

    /**
     * set
     *
     * @param strategyName strategyName
     */
    public void setStrategyName(String strategyName) {
        this.strategyName = strategyName;
    }

    /**
     * get
     *
     * @return StrategyParam
     */
    public String getStrategyParam() {
        return strategyParam;
    }

    /**
     * set
     *
     * @param strategyParam strategyParam
     */
    public void setStrategyParam(String strategyParam) {
        this.strategyParam = strategyParam;
    }

    /**
     * get
     *
     * @return EnableDefault
     */
    public int getEnableDefault() {
        return enableDefault;
    }

    /**
     * set
     *
     * @param enableDefault enableDefault
     */
    public void setEnableDefault(int enableDefault) {
        this.enableDefault = enableDefault;
    }

    /**
     * get
     *
     * @return ClusterInfos
     */
    public List<EngineClusterInfo> getClusterInfos() {
        return clusterInfos;
    }

    /**
     * set
     *
     * @param clusterInfos clusterInfos
     */
    public void setClusterInfos(List<EngineClusterInfo> clusterInfos) {
        this.clusterInfos = clusterInfos;
    }

    /**
     * 转换成vo
     *
     * @return vo
     */
    public List<ClusterInfoVO> toVO() {
        List<ClusterInfoVO> clusterInfoVOS = new ArrayList<>();
//        for (ClusterInfo clusterInfo : clusterInfos) {
//            List<String> clusterNames = clusterInfo.getClusterNames();
//            ClusterInfoVO vo = new ClusterInfoVO();
//            vo.setManufacturer(clusterInfo.getManufacturer());
//            vo.setClusterNames(clusterNames);
//            clusterInfoVOS.add(vo);
//        }
        return clusterInfoVOS;
    }
}
